/*
 *审批中心接口
 * */
define(function(require, exports, module) {
	var abpdata = require("abpinit");
	var abp = abpdata.abpstart;
	//dataModel需要传的模型值,option非必要参数，默认传空对象，done异步完成，fail异步失败，data.success数值成功返回
	/*审批历史*/
	var getHistoryList = {
		historyCon: function(templateId, mainId, sourceType, sourceId) {
			var option = {};
			var dataModel = {
				"sourceType": sourceType, //来源类型 
				"sourceId": sourceId
			};
			abp.services.app.auditList.auditHistory(dataModel, option).
			done(function(data) {
				console.log(data);
				var data1 = {};
				data1.list = data;
				var html = template(templateId, data1);
				$(mainId).html(html);
				if(data.success) {

				} else {

				}
			}).fail(function(data) {

			});
		},
		funAudit: function(AuditId, Audit_detailId, isok, notes) {
			var option = {};
			var dataModelOK = {
				"auditId": AuditId,
				"audit_detailId": Audit_detailId,
				"auditResult": isok,
				"notes": notes
			};
			abp.services.app.auditList.audit(dataModelOK, option).
			done(function(data) {
				if(data.success) {} else {}
			}).fail(function(data) {});
		},
		funIsAuditSetting: function(sourceType, sourceId) {
			var option = {};
			var dataModelSetting = {
				"sourceType": sourceType,
				"sourceId": sourceId
			};
			abp.services.app.auditSettingList.isAuditSetting(dataModelSetting, option).
			done(function(data) {
				console.log(data);
				if(data.success) {} else {}
			}).fail(function(data) {});
		}
	};
	module.exports = getHistoryList;
});